import React from 'react'
import { Router, Switch, Route } from 'react-router-dom'

import {connect} from 'react-redux'
import {bindActionCreators} from 'redux'
import { actions as UserAction } from '../../reducers/user'

import {PLHOC} from './components/pl-hoc'
import Layout from './components/layout'
import Publish from './publish'
import Execute from './execute'
import Grab from './grab'

import history from '../../history'

class MyProject extends React.Component {
    render() {
        return (
            <Router history={history}>
                <Switch>
                    <Route path="/my-project/publish" component={WrapPublish()}/>
                    <Route path="/my-project/execute" component={WrapExecute()}/>
                    <Route path="/my-project/grab" component={WrapGrab()}/>
                </Switch>
            </Router>  
        )
    }
}

const WrapPublish = () => 
    PLHOC(Publish)

const WrapExecute = () => 
    PLHOC(Execute)

const WrapGrab = () => 
    PLHOC(Grab)

function mapStateToProps(state) {
    return {
    }
}
  
function mapDispatchToProps(dispatch) {
    return  {
    }
}
  
export default connect(
    mapStateToProps,
    mapDispatchToProps
)(MyProject)